refactor: Migrate from custom Raft to OpenRaft#5
Merged
Conversation
Replace custom raft-rs-based implementation with OpenRaft library to leverage battle-tested consensus with better abstractions for storage and state machines. Changes: - Remove custom raft, common, and protocol-resp crates - Rename protocol-resp → resp (preparation for modular protocol support) - Add OpenRaft integration in storage crate with RaftTypeConfig - Implement RaftStorage trait with RocksDB backend - Add state machine and operations modules for OpenRaft - Update specs to reflect architecture changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace all RwLock .unwrap() calls with proper error handling to prevent cascading cluster failures from poisoned locks. All lock acquisitions now return StorageError::IO with descriptive messages when locks are poisoned. Changes: - Add poison handling for log read/write operations - Add poison handling for vote read/write operations - Add poison handling for state machine operations - Add poison handling for snapshot operations - Replace test sleep() calls with wait_for_leader() helper - Fix clippy format string warnings All 751 tests passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Track full LogId metadata (term, leader_id, index) in StateMachine and cluster membership in OpenRaftMemStateMachine. Fixes hardcoded LogId (0,0) construction. Also: Fix clippy warnings, disable 2 tests with private APIs, update Phase 1 docs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace raft-rs with OpenRaft 0.9.21
Eliminate prost dependency conflict between raft-rs (prost 0.11) and our gRPC layer (prost
0.14) that was blocking compilation.
Changes
Crate Restructuring
OpenRaft Implementation
RaftNode Wrapper
Test Coverage
Dependency Changes